<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%
	if (session.getAttribute("username") != null) {
		response.sendRedirect("welcome.jsp");
	}
if (request.getParameter("error") == null) { 
	
	
	response.sendRedirect("QM_qualitymanual.jsp");

}
else if (request.getParameter("error").equals("2"))
	response.sendRedirect("welcome.jsp");
	
%>

<!-- Declare the first header -->
<jsp:include page="t_header.jsp" />



<script type="text/javascript">
$(function(){
     $("#username").onkeyup(function(){
          if ($(this).val() == "") {
               $(".alt_btn").prop("disabled", true);
          } else {
               $(".alt_btn").prop("disabled", false);
          }
     });
});
</script>

<link rel="stylesheet" type="text/css" href="css/contentslider.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/contentslider.js"></script>


<jsp:include page="header.html" />
<!-- Declare sidebar -->
<jsp:include page="t_sidebar.jsp" />

<!-- Main Content -->
<body>
	<section id="main" class="column">

		<%
			if (request.getParameter("error") != null) {
				if (request.getParameter("error").equals("1"))
					out.print("<h4 class='alert_error'>Error - Your username / password was incorrect.</h4>");
			//	else if (request.getParameter("error").equals("2"))
				//	out.print("<h4 class='alert_info'>You have Signned Out successfully.</h4>");
				else if (request.getParameter("error").equals("3"))
					out.print("<h4 class='alert_error'>Sign In required to be able to view this page.</h4>");
				else if (request.getParameter("error").equals("4"))
					out.print("<h4 class='alert_error'>Please fill in both fields to sign in.</h4>");
				
			}
			
		%>


		<div class="clear"></div>

		<%
			if (request.getParameter("error") == null) { 
			
				
			%>
			
	<div id="topbanner" style="margin-left:24%;margin-top:10%">

			<div id="wowslider-container1">
				<div class="ws_images">
					<ul>
						<li><img src="images/banner1.jpg" alt="banner1" id="wows1_0" /></li>
						<li><img src="images/banner2.jpg" alt="banner2" id="wows1_1" /></li>
						<li><img src="images/banner3.jpg" alt="banner3" id="wows1_2" /></li>
						<li><img src="images/banner4.jpg" alt="banner4" id="wows1_3" /></li>
					</ul>
				</div>

				<div class="ws_shadow"></div>
			</div>
			<script type="text/javascript" src="js/wowslider.js"></script>
			<script type="text/javascript" src="js/script.js"></script>

			<script type="text/javascript">
			featuredcontentslider.init({
				id : "slider2",
				contentsource : [ "inline", "" ],
				toc : "markup",
				nextprev : [ "Previous", "Next" ],
				revealtype : "click",
				enablefade : [ true, 0.2 ],
				autorotate : [ true, 3000 ],
				onChange : function(previndex, curindex) {
				}
			});
		</script>
	</div>
<% 
			
			} else if (request.getParameter("error") != null)
		{
			if (request.getParameter("error").equals("-1"))
				out.print("<h4 class='alert_error'>Your username or password is incorrect!</h4>");

		} %>
		<article class="module width_half">
			<header>
				<h3>Sign In</h3>
			</header>
			<form action="Credential_BLL" method="POST">
				<div class="module_content">
					<fieldset style="width: 48%; float: left; margin-right: 3%;">
						<!-- to make two field float next to one another, adjust values accordingly -->
						<label>Username</label> <input class="namepass2" id="username" type="text" name="username"
							style="width: 82%;">
					</fieldset>
					<fieldset style="width: 48%; float: left;">
						<!-- to make two field float next to one another, adjust values accordingly -->
						<label>Password</label> <input class="namepass2" id="password" type="password" name="password"
							style="width: 82%;">
					</fieldset>
					<div class="clear"></div>
				</div>
				<footer>
					<div class="submit_link">
						<input id="loginsubmit2" type="submit" disabled="disabled"  value="Sign In" class="alt_btn">
					</div>
				</footer>
			</form>
		</article>
		<!-- end of post new article -->


	</section>

	<!-- Declare closing tags -->
	<jsp:include page="t_footer.jsp" />